#ifndef __USER_H_
#define __USER_H_

#include <glib-2.0/glib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>

#include <gnutls/gnutls.h>
#include "user.h"

#define PACKET_MAGIC 0xDEADBEEF

gnutls_session_t nio_session;
gnutls_anon_client_credentials_t nio_cred;

typedef struct {
	long magic;
	size_t size;
	char flags;
} packet_t;

int
nio_packet_send(gnutls_session_t session,
				void *data,
				size_t len);

int
nio_packet_recv();

int
nio_send(void *data,
		 size_t size,
		 char flags);

int
nio_recv(void **buffer,
		 char *flags);

int
nio_init();

#endif

